package com.powergisol.gis.vo;



import java.util.List;

public class FeatureType {

    private String type;

    private CRSInfo nativeCRS;

    private String title;

    private String name;

    private CRSInfo crs;

    private NativeBoundingBox nativeBoundingBox;

    private LatLonBoundingBox latLonBoundingBox;

    private String file;

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public CRSInfo getCrs() {
        return crs;
    }

    public void setCrs(CRSInfo crs) {
        this.crs = crs;
    }

    public NativeBoundingBox getNativeBoundingBox() {
        return nativeBoundingBox;
    }

    public void setNativeBoundingBox(NativeBoundingBox nativeBoundingBox) {
        this.nativeBoundingBox = nativeBoundingBox;
    }

    public LatLonBoundingBox getLatLonBoundingBox() {
        return latLonBoundingBox;
    }

    public void setLatLonBoundingBox(LatLonBoundingBox latLonBoundingBox) {
        this.latLonBoundingBox = latLonBoundingBox;
    }

    public String getFile() {
        return file;
    }

    public void setFile(String file) {
        this.file = file;
    }

    public boolean isEnabled() {
        return enabled;
    }

    public void setEnabled(boolean enabled) {
        this.enabled = enabled;
    }

    /**
     * 是否可用
     */
    private boolean enabled;

    public void setNativeCRS(CRSInfo nativeCRS) {
        this.nativeCRS = nativeCRS;
    }

    public CRSInfo getNativeCRS() {
        return nativeCRS;
    }

    private Attributes attributes;

    public void setAttributes(Attributes attributes) {
        this.attributes = attributes;
    }

    public Attributes getAttributes() {
        return attributes;
    }

    @Override
    public String toString() {
        return "FeatureType{" +
                "type='" + type + '\'' +
                ", nativeCRS=" + nativeCRS +
                ", title='" + title + '\'' +
                ", name='" + name + '\'' +
                ", crs=" + crs +
                ", nativeBoundingBox=" + nativeBoundingBox +
                ", latLonBoundingBox=" + latLonBoundingBox +
                ", file='" + file + '\'' +
                ", enabled=" + enabled +
                ", attributes=" + attributes +
                '}';
    }

    public static class NativeBoundingBox {

        private double minx;
        private double maxx;
        private double miny;
        private double maxy;
        private String crs;

        public NativeBoundingBox(double minx,double maxx,double miny,double maxy,String crs){
            this.crs = crs;
            this.maxx = maxx;
            this.minx = minx;
            this.maxy = maxy;
            this.miny = miny;
        }

        public double getMinx() {
            return minx;
        }

        public void setMinx(double minx) {
            this.minx = minx;
        }

        public double getMaxx() {
            return maxx;
        }

        public void setMaxx(double maxx) {
            this.maxx = maxx;
        }

        public double getMiny() {
            return miny;
        }

        public void setMiny(double miny) {
            this.miny = miny;
        }

        public double getMaxy() {
            return maxy;
        }

        public void setMaxy(double maxy) {
            this.maxy = maxy;
        }

        public String getCrs() {
            return crs;
        }

        public void setCrs(String crs) {
            this.crs = crs;
        }

        @Override
        public String toString() {
            return "NativeBoundingBox{" +
                    "minx=" + minx +
                    ", maxx=" + maxx +
                    ", miny=" + miny +
                    ", maxy=" + maxy +
                    ", crs='" + crs + '\'' +
                    '}';
        }
    }

    public static class LatLonBoundingBox {
        /**
         * minx : -103.8725637911543
         * maxx : -103.63794182141925
         * miny : 44.37740330855979
         * maxy : 44.48804280772808
         * crs : EPSG:4326
         */

        private double minx;
        private double maxx;
        private double miny;
        private double maxy;
        private String crs;

        public LatLonBoundingBox(double minx,double maxx,double miny,double maxy,String crs){
            this.crs = crs;
            this.maxx = maxx;
            this.minx = minx;
            this.maxy = maxy;
            this.miny = miny;
        }

        @Override
        public String toString() {
            return "LatLonBoundingBox{" +
                    "minx=" + minx +
                    ", maxx=" + maxx +
                    ", miny=" + miny +
                    ", maxy=" + maxy +
                    ", crs='" + crs + '\'' +
                    '}';
        }

        public double getMinx() {
            return minx;
        }

        public void setMinx(double minx) {
            this.minx = minx;
        }

        public double getMaxx() {
            return maxx;
        }

        public void setMaxx(double maxx) {
            this.maxx = maxx;
        }

        public double getMiny() {
            return miny;
        }

        public void setMiny(double miny) {
            this.miny = miny;
        }

        public double getMaxy() {
            return maxy;
        }

        public void setMaxy(double maxy) {
            this.maxy = maxy;
        }

        public String getCrs() {
            return crs;
        }

        public void setCrs(String crs) {
            this.crs = crs;
        }
    }

    public static class Attributes {
        private List<Attribute> attribute;

        public List<Attribute> getAttribute() {
            return attribute;
        }

        public void setAttribute(List<Attribute> attribute) {
            this.attribute = attribute;
        }

        @Override
        public String toString() {
            return "Attributes{" +
                    "attribute=" + attribute +
                    '}';
        }

        public static class Attribute {
            /**
             * name : the_geom
             * minOccurs : 0
             * maxOccurs : 1
             * nillable : false
             */

            private String name;
            private int minOccurs;
            private int maxOccurs;
            private boolean nillable;

            private String type;

            public String getName() {
                return name;
            }

            public void setName(String name) {
                this.name = name;
            }

            public int getMinOccurs() {
                return minOccurs;
            }

            public void setMinOccurs(int minOccurs) {
                this.minOccurs = minOccurs;
            }

            public int getMaxOccurs() {
                return maxOccurs;
            }

            public void setMaxOccurs(int maxOccurs) {
                this.maxOccurs = maxOccurs;
            }

            public boolean isNillable() {
                return nillable;
            }

            public void setNillable(boolean nillable) {
                this.nillable = nillable;
            }

            public void setType(String type) {
                this.type = type;
            }

            public String getType() {
                return type;
            }

            @Override
            public String toString() {
                return "Attribute{" +
                        "name='" + name + '\'' +
                        ", minOccurs=" + minOccurs +
                        ", maxOccurs=" + maxOccurs +
                        ", nillable=" + nillable +
                        ", type='" + type + '\'' +
                        '}';
            }
        }
    }
}




